package com.fanfanwang.ffw.app.net;

import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;

import com.fanfanwang.ffw.app.net.ParamsList.Parameter;

public class ParamsList extends ArrayList<Parameter> {

	/**
     * 
     */
	private static final long serialVersionUID = 1L;

	public static abstract class Parameter {
		String name;
	}

	public static class StringParameter extends Parameter {
		String value;

		public StringParameter(String name, String value) {
			super();
			if (name == null) {
				throw new RuntimeException("args can not be null");
			}
			this.name = name;
			this.value = value;
		}

	}

	public static class InputStreamParameter extends Parameter {
		InputStream value;
		String fileName;

		public InputStreamParameter(String name, InputStream value,
				String fileName) {
			super();
			if (name == null || value == null || fileName == null) {
				throw new RuntimeException("args can not be null");
			}
			this.name = name;
			this.value = value;
			this.fileName = fileName;
		}

	}

	public static class FileParameter extends Parameter {
		File value;

		public FileParameter(String name, File value) {
			super();
			if (name == null || value == null) {
				throw new RuntimeException("args can not be null");
			}
			this.name = name;
			this.value = value;
		}
	}

	public static class HeaderParameter extends Parameter {
		String value;

		public HeaderParameter(String name, String value) {
			super();
			if (name == null || value == null) {
				throw new RuntimeException("args can not be null");
			}
			this.name = name;
			this.value = value;
		}
	}

}
